<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
    <style type="text/css">
        #allmap {width: 100%;height: 100%;font-family:"微软雅黑";}
    </style>
    <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=nSxiPohfziUaCuONe4ViUP2N"></script>
    <title>IP定位获取当前城市</title>
</head>
<div class="layui-form-item">
        <label class="layui-form-label">客户名称<span style="color: red;">*</span></label>
        <div class="layui-input-block">
            ${customer.name}
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">手机号<span style="color: red;">*</span></label>
        <div class="layui-input-block">
            ${customer.mobile}
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">详细地址<span style="color: red;">*</span></label>
        <div class="layui-input-block">
            <input type="hidden" id ="address" name="address" value="${customer.address}" />
            ${customer.address}
        </div>
    </div>
<div class="layui-form-item">
    <label class="layui-form-label">信誉度<span style="color: red;">*</span></label>
    <div class="layui-input-block">
        ${customer.status}
    </div>
</div>

    <div class="layui-form-item text-right">

        <div id="allmap"></div>

        <script type="text/javascript">
            // 百度地图API功能
            var map = new BMap.Map("allmap");
            var point = new BMap.Point(116.331398,39.897445);
            map.centerAndZoom(point,18);
                    var city = document.getElementById("address").value;
            if(city != "") {
                map.centerAndZoom(city, 18);      // 用城市名设置地图中心点
            }

        </script>

    </div>
